package com.yjd.msg.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.yjd.msg.comm.model.MsgDisposeLogModel;
import com.yjd.msg.comm.service.IMsgDisposeLogService;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.msg.dao.IMsgDisposeLogDao;

/**
 * <b>description</b>：消息处理日志表业务实现<br>
 * <b>time</b>：2018-01-24 16:39:04 <br>
 * <b>author</b>：  carl
 */
@Service("msgDisposeLogService")
public class MsgDisposeLogServiceImpl extends BaseServiceImpl implements IMsgDisposeLogService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public MsgDisposeLogModel insert(MsgDisposeLogModel model) throws Exception {
		return this.msgDisposeLogDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(MsgDisposeLogModel model) throws Exception {
		return this.msgDisposeLogDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.msgDisposeLogDao.deleteModel(paramMap, true);
	}

	@Override
	public void batchInsertModel(List<MsgDisposeLogModel> list) throws Exception {
		this.msgDisposeLogDao.insertBatch(list,true);
	}

	@Resource
	private IMsgDisposeLogDao msgDisposeLogDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.msgDisposeLogDao;
	}

}
